<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
include('base.php');
class News extends Base 
{

	public function __construct()
	{
		$this->table_name = 'news';
		$this->template = 'default/'; // 模板文件目录
		parent::__construct();
	}
	public function index()
	{
		
		$data['seo'] = $this->site['site'][0];
		$data['lanmu'] = $this->site['lanmu'];
		$data['category_type'] = $this->site['category_type'];
		$this->load->model('editor'); 
		$url=site_url('news/index/');
		$where="";
		$newslist=$this->editor->show_list($this->table_name,$url,3,$this->uri->segment(3),$where,'id'); 
		//print_r($newslist);
		$this->load->view($this->template.'header',$data);
		$this->load->view($this->template.'list',$newslist);
		$this->load->view($this->template.'footer');
		//print_r($this->site['site']);
	}
	public function show()
	{
		$id = $this->uri->segment(3);
		$data['seo'] = $this->site['site'][0];
		$data['lanmu'] = $this->site['lanmu'];
		$data['category_type'] = $this->site['category_type'];
		$where="";
		$newslist['show']=$this->db->get_where('news',array('id'=>$id))->row_array(); 
		//print_r($newslist);
		$this->load->view($this->template.'header',$data);
		$this->load->view($this->template.'show',$newslist);
		$this->load->view($this->template.'footer');
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */